package com.poss.gui;

import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author shan
 */
public class PossGuiManager {
    
    private static PossGuiManager singleReference = null;
    Map<String, PossGuiWindow> windowMap = new HashMap<String, PossGuiWindow>();
    
    private PossGuiManager() {
        windowMap.put("LOGIN_WINDOW", new PossLoginForm());
        windowMap.put("MAIN_WINDOW", new PossMainForm());
    }
    
    public static PossGuiManager getReference() {
        if (singleReference == null) {
            singleReference = new PossGuiManager();
        }
        return singleReference;
    }
    
    public PossGuiWindow getWindow(String name) {
        if (name.equals("LOGIN_WINDOW")) {
            return windowMap.get(name);
        } else if (name.equals("MAIN_WINDOW")) {
            return windowMap.get(name);
        }
        return null;
    }
    
}
